package com.brodong.animal_remake.common.skills.Mirror;

import com.brodong.animal_remake.common.entities.monster.realization.SkillBasicEntity;
import com.brodong.animal_remake.common.skills.Currentskills;
import com.brodong.animal_remake.common.skills.UseskillGoal;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.monster.Illusioner;
import net.minecraft.world.entity.monster.SpellcasterIllager;

import javax.annotation.Nullable;

public class MirrorSkillGoal extends UseskillGoal {
    public MirrorSkillGoal(SkillBasicEntity mo) {
        super(mo,20,20,340);
    }
    public MirrorSkillGoal(SkillBasicEntity mo,int CastWarmup,int Casting,int CastingInterval){
        super(mo,CastWarmup,Casting,CastingInterval);
    }
    public boolean canUse() {
        if (!super.canUse()) {
            return false;
        } else {
            return !mob.hasEffect(MobEffects.INVISIBILITY);
        }
    }
    protected void performSpellCasting() {
        mob.addEffect(new MobEffectInstance(MobEffects.INVISIBILITY, 1200));
    }

    @Nullable
    protected SoundEvent getSpellPrepareSound() {
        return SoundEvents.ILLUSIONER_PREPARE_MIRROR;
    }

    protected Currentskills getSpell() {
        return Currentskills.DISAPPEAR;
    }
}